#include <stdio.h>

int strncmp(const char *lhs, const char *rhs, size_t count)
{
	if (count == 0)
		return 0;

	while (*lhs == *rhs)
	{
		if (*lhs == '\0' \
			|| --count == 0)
			return 0;
		++lhs, ++rhs;
	}
	return *lhs - *rhs > 0 ? 1 : -1;
}

int main()
{
	printf("%d\n", strncmp("universe", "universal", 7));
	return 0;
}
